
# $Id: Object.pm 96 2013-03-25 07:47:45Z chengxin.cai $

package Provision::Object;

use strict;

use config;
use Provision::Utils qw(performStep);

sub new {
    my ($proto, $id) = @_;
    my $class = ref $proto || $proto;

    my $self = bless {}, $class;

    $self->{id} = $id;

    return $self;
}

sub id { my $self = shift; return $self->{id}; }

sub get_idarg { return '';}

sub create {
    my ($self, $steps_ref, $test) = @_;

    for my $step ( @{$steps_ref} ) {
        my $ret = performStep($self, $step, $test);

        return $ret if ($ret != config::OK);
    }

    return config::OK;
}

sub delete {
    my ($self, $steps_ref, $test) = @_;

    for my $step ( @{$steps_ref} ) {
        my $ret = performStep($self, $step, $test);

        return $ret if ( $ret != config::OK );
    }

    return config::OK;

}

1;

